package com.admin.web;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.admin.bean.MyUser;
import com.admin.mapper.MyUserMapper;
import com.admin.service.MyUserService;

@RestController
@RequestMapping("www")
public class WwwController {
	@Autowired
	protected MyUserService userService;
	@Autowired
	protected MyUserMapper myUserMapper;
	
	@RequestMapping("userList")
	@Transactional
	private Object userList() {
		List<MyUser> list = new ArrayList<MyUser>();
//		MyUser user1 = new MyUser("01", "用户1", "13211911887", "中国河北", new Date(), "shengchong@qq.com");
//		MyUser user2 = new MyUser("02", "用户2", "13211911287", "中国河南", new Date(), "zhangsan@qq.com");
//		MyUser user3 = new MyUser("03", "用户3", "13211923287", "中国河北", new Date(), "wuxiaoxu@qq.com");
//		MyUser user4 = new MyUser("04", "用户4", "13211911887", "中国山西", new Date(), "wuxinyi@qq.com");
//		MyUser user5 = new MyUser("05", "用户5", "13211914387", "中国海南", new Date(), "323701948@qq.com");
//		list.add(user1);
//		list.add(user2);
//		list.add(user3);
//		list.add(user4);
//		list.add(user5);
		
		list = userService.list();
		
		
//		MyUser user = myUserMapper.findById(1L);
//		int i = myUserMapper.insert(4L, "盛冲", "行唐县", "1230232332", "yiranleng@qq.com", new Date());
//		
//		System.out.println(i);
//		System.out.println(i);
//		System.out.println(i);
//		System.out.println(i);
//		System.out.println(i);

		return list;

		
		
	}
}
